package com.javalong.affairs.module.renwujinzhang.activity.suggest.activity;

import android.content.Context;
import android.content.Intent;
import android.widget.TextView;

import com.javalong.affairs.R;
import com.javalong.affairs.base.activity.ToolbarActivity;
import com.javalong.affairs.base.constant.BundleKey;
import com.javalong.affairs.base.model.Suggest;
import com.javalong.affairs.base.utils.TimeUtils;

/**
 * Created by javalong on 2016/5/22.
 * 建议内容
 */

public class SuggestContentActivity extends ToolbarActivity {

    public static void toThisActivity(Context context, Suggest suggest) {
        Intent intent = new Intent();
        intent.setClass(context, SuggestContentActivity.class);
        intent.putExtra(BundleKey.SUGGEST, suggest);
        context.startActivity(intent);
    }

    @Override
    protected void initLayout() {
        setContentView(R.layout.activity_suggestcontent);
    }


    @Override
    protected void initData() {
        getSupportActionBar().setTitle("建议内容");
        TextView tv_username = (TextView) findViewById(R.id.tv_username);
        TextView tv_content = (TextView) findViewById(R.id.tv_content);
        TextView tv_time = (TextView) findViewById(R.id.tv_time);
        Suggest suggest = (Suggest) getIntent().getSerializableExtra(BundleKey.SUGGEST);
        if (suggest != null) {
            tv_content.setText(suggest.getContent());
            tv_username.setText(suggest.getUserName());
            tv_time.setText(TimeUtils.getFormatTime2(suggest.getTimeCreate()));
        }
    }
}
